package com.example.zhugenew.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.mymvplibrary.adapter.BaseAdapter;
import com.example.mymvplibrary.adapter.BaseViewHolder;
import com.example.zhugenew.R;

import java.util.List;

public class NavigationReAdapter extends BaseAdapter<HouseBean.ListBean> {
    private OnclickLisertener lisertener;
    public NavigationReAdapter(List<HouseBean.ListBean> datas, Context context, int layoutId) {
        super(datas, context, layoutId);
    }

    @Override
    public void bindData(BaseViewHolder holder, HouseBean.ListBean listBean, int pos) {
        ImageView imageView=holder.getView(R.id.navigIV);
        Glide.with(context).load(listBean.getIcon()).into(imageView);
        TextView textView = holder.getView(R.id.navigTv);
        textView.setText(listBean.getTitle());

        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (lisertener!=null){
                    lisertener.onclick(pos);
                }
            }
        });
    }



    public void setLisertener(OnclickLisertener lisertener){
        this.lisertener=lisertener;
    }
    public interface  OnclickLisertener{
        void onclick(int pos);
    }
}
 